package com.example.app.network.api

import com.example.app.data.bean.BaseResponseData
import com.example.app.network.createWebService
import com.example.app.util.CacheUtil
import retrofit2.http.*

interface CollectionService {
    companion object {
        var service = createWebService(
            ServiceConfig.SERVER_URL,
            CollectionService::class.java
        )
    }
    //查询笔记
    @FormUrlEncoded
    @POST("collection/listNote")
    suspend fun collectionListNote(
        @Field("CreatorId") CreatorId: String? = CacheUtil.getUserId(),
        @Field("LabelId") LabelId: String? = null,
        @Field("Type") Type: String? = "NOTE",
        @Field("pageNum") pageNum: Int? = null,
        @Field("pageSize") pageSize: Int? = null,
    ): BaseResponseData<Any>
    //新增笔记
    @FormUrlEncoded
    @POST("collection/content/add")
    suspend fun collectionAdd(
        @Field("CreatorId") CreatorId: String? = CacheUtil.getUserId(),
        @Field("LabelId") LabelId: String? = null,
        @Field("Type") Type: String? = "NOTE",
        @Field("PostId") PostId: String? = null,
        @Field("Content") Content: String? = null,
        @Field("Title") Title: String? = null,
        @Field("Image") Image: String? = null,
        @Field("Position") Position: String? = null,
    ): BaseResponseData<Any>
    //更新笔记
    @FormUrlEncoded
    @POST("collection/content/update")
    suspend fun collectionUpdate(
        @Field("id") id: String? = null,
        @Field("Content") Content: String? = null,
        @Field("Title") Title: String? = null,
        @Field("Image") Image: String? = null,
        @Field("Position") Position: String? = null,
    ): BaseResponseData<Any>
}

